import axiosApi from "./AxiosApi.js";
// 仪器管理
const apparatusManage = {
  // 分页列表查询
  page: {
    url: `/xssc/instrument/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/instrument`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/instrument`,
    method: "PUT"
  },
  // 删除
  delete: {
    url: `/xssc/instrument`,
    method: "DELETE"
  }
};

// 试剂管理

const reagentManage = {
  // 分页列表查询
  page: {
    url: `/xssc/consumables/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/consumables`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/consumables`,
    method: "PUT"
  },
  // 删除
  delete: {
    url: `/xssc/consumables`,
    method: "DELETE"
  },
  // 质控查询
  queryQuality: {
    url: `/xssc/consumables/queryQuality`,
    method: "GET"
  },
  // 试剂查询
  queryReagent: {
    url: `/xssc/consumables/queryReagent`,
    method: "GET"
  },
  // 质控指标查询
  queryQualityIndicator: {
    url: `/xssc/consumables/queryQualityIndicator`,
    method: "POST"
  }
};

// 仪器维修
const repairManage = {
  // 分页列表查询
  page: {
    url: `/xssc/instrumentMaintain/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/instrumentMaintain`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/instrumentMaintain`,
    method: "PUT"
  },
  // 删除
  delete: {
    url: `/xssc/instrumentMaintain`,
    method: "DELETE"
  },
};


export default {
  apparatusManage: {
    page(data) {
      return axiosApi({
        ...apparatusManage.page,
        // formData: true,
        data
      });
    },
    add(data) {
      return axiosApi({
        ...apparatusManage.add,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...apparatusManage.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...apparatusManage.delete,
        // formData: true,
        data
      });
    }
  },
  reagentManage: {
    page(data) {
      return axiosApi({
        ...reagentManage.page,
        // formData: true,
        data
      });
    },
    add(data) {
      return axiosApi({
        ...reagentManage.add,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...reagentManage.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...reagentManage.delete,
        // formData: true,
        data
      });
    },
    queryQuality(data) {
      return axiosApi({
        ...reagentManage.queryQuality,
        // formData: true,
        data
      });
    },
    queryReagent(data) {
      return axiosApi({
        ...reagentManage.queryReagent,
        // formData: true,
        data
      });
    },
    getById(data) {
      return axiosApi({
        url: `/xssc/consumables/${data}`,
        method: "GET"
      });
    },
    queryQualityIndicator(data) {
      return axiosApi({
        ...reagentManage.queryQualityIndicator,
        // formData: true,
        data
      });
    }
  },
  repairManage: {
    add(data) {
      return axiosApi({
        ...repairManage.add,
        // formData: true,
        data
      });
    },
    page(data) {
      return axiosApi({
        ...repairManage.page,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...repairManage.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...repairManage.delete,
        // formData: true,
        data
      });
    },
  }

};
